package models;

import java.io.Serializable;
import javax.persistence.*;

import java.util.Date;

/**
 * The persistent class for the pay_detail database table.
 * 
 */
@Entity
@Table(name = "PAY_DETAIL")
public class PayDetail implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @TableGenerator(
            name = "PAY_DETAIL_SEQ",
            table = "SEQUENCE",
            pkColumnName = "NAME",
            pkColumnValue = "PAY_DETAIL_SEQ",
            valueColumnName = "CNT",
            initialValue = 10000,
            allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "PAY_DETAIL_SEQ")
    @Column(unique = true, nullable = false)
    private Integer id;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "COMPLETION_D")
    private Date completionD;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATE_D")
    private Date createD;

    private double interest;

    @Column(name = "LATE_FEE")
    private double lateFee;

    @Column(name = "LENDER_FEE")
    private double lenderFee;

    @Column(name = "LOAN_ID")
    private Integer loanId;
    
    @Column(name="TRANS_ID")
    private Integer transId;

    @Column(name = "MANAGEMENT_FEE")
    private double managementFee;

    @Column(name = "ORDER_DETAIL_ID")
    private Integer orderDetailId;

    @Column(name = "PAY_ID")
    private Integer payId;

    private double principal;

    private int status;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "UPDATE_D")
    private Date updateD;

    public PayDetail() {
    }

    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getCompletionD() {
        return this.completionD;
    }

    public void setCompletionD(Date completionD) {
        this.completionD = completionD;
    }

    public Date getCreateD() {
        return this.createD;
    }

    public void setCreateD(Date createD) {
        this.createD = createD;
    }

    public double getInterest() {
        return this.interest;
    }

    public void setInterest(double interest) {
        this.interest = interest;
    }

    public double getLateFee() {
        return this.lateFee;
    }

    public void setLateFee(double lateFee) {
        this.lateFee = lateFee;
    }

    public double getLenderFee() {
        return this.lenderFee;
    }

    public void setLenderFee(double lenderFee) {
        this.lenderFee = lenderFee;
    }

    public Integer getLoanId() {
        return this.loanId;
    }

    public void setLoanId(Integer loanId) {
        this.loanId = loanId;
    }

    public double getManagementFee() {
        return this.managementFee;
    }

    public void setManagementFee(double managementFee) {
        this.managementFee = managementFee;
    }

    public Integer getOrderDetailId() {
        return this.orderDetailId;
    }

    public void setOrderDetailId(Integer orderDetailId) {
        this.orderDetailId = orderDetailId;
    }

    public Integer getPayId() {
        return this.payId;
    }

    public void setPayId(Integer payId) {
        this.payId = payId;
    }

    public double getPrincipal() {
        return this.principal;
    }

    public void setPrincipal(double principal) {
        this.principal = principal;
    }

    public Status getStatus() {
        return Status.values()[this.status];
    }

    public void setStatus(Status status) {
        this.status = status.ordinal();
    }

    public Date getUpdateD() {
        return this.updateD;
    }

    public void setUpdateD(Date updateD) {
        this.updateD = updateD;
    }
    
    

    public Integer getTransId() {
        return transId;
    }

    public void setTransId(Integer transId) {
        this.transId = transId;
    }



    public static enum Status {
        ANY, // 0 - internal status for admin app. use only
        PENDING, // 1 -
        COMPLETED, // 2 - 
        ;
    }
}